/*  1:   */package com.java.diagnostics.visualizer.recommender.occupancy;
/*  2:   */
/*  3:   */import com.java.diagnostics.visualizer.data.AggregateData;
/*  4:   */import com.java.diagnostics.visualizer.data.TupleData;
/*  5:   */import com.java.diagnostics.visualizer.gc.recommender.RecommendationPreferenceHelper;
/*  6:   */import com.java.diagnostics.visualizer.recommender.Recommendation;
/*  7:   */import com.java.diagnostics.visualizer.recommender.RecommendationBase;
/*  8:   */import com.java.diagnostics.visualizer.recommender.util.RecommendationLabels;
/*  9:   */import java.text.MessageFormat;
/* 10:   */
/* 23:   */public class OccupancyRecommendation
/* 24:   */  extends RecommendationBase
/* 25:   */  implements Recommendation
/* 26:   */{
/* 27:   */  public void recommend(AggregateData data)
/* 28:   */  {
/* 29:29 */    Object gcMode = getGCMode(data);
/* 30:30 */    if ((!"gencon".equals(gcMode)) && (!"balanced".equals(gcMode)) && (!isSun(data))) {
/* 31:31 */      TupleData usedHeap = data
/* 32:32 */        .getTupleData("VGCLabels.live.normal.heap.after.gc");
/* 33:   */      
/* 34:34 */      if ((usedHeap != null) && (!usedHeap.isEmpty())) {
/* 35:35 */        int meanOccupancy = getMeanAsPercent(usedHeap);
/* 36:36 */        if (meanOccupancy >= this.helper.getHighOccupancyThreshold()) {
/* 37:37 */          String string = MessageFormat.format(
/* 38:38 */            RecommendationLabels.HIGH_OCCUPANCY_MESSAGE, 
/* 39:39 */            new Object[] { Integer.valueOf(meanOccupancy) });
/* 40:40 */          addWarning(data, string);
/* 41:41 */          suggestHeapSizes(data);
/* 42:   */        }
/* 43:   */      }
/* 44:   */    }
/* 45:   */  }
/* 46:   */}


